# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kscreen
pkgver=5.19.4
pkgrel=0
pkgdesc="KDE's screen management software"
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
url="https://www.kde.org/workspaces/plasmadesktop/"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
depends="hicolor-icon-theme"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtsensors-dev kdbusaddons-dev kconfig-dev kconfigwidgets-dev ki18n-dev kxmlgui-dev kglobalaccel-dev kwidgetsaddons-dev kdeclarative-dev kiconthemes-dev plasma-framework-dev libkscreen-dev kcmutils-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/plasma/$pkgver/kscreen-$pkgver.tar.xz"
subpackages="$pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	# kscreen-kded-configtest is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "kscreen-kded-configtest"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="0e392d2dfa550b5df356bf1de7f2da0db29e834a9735a048cd29beb1560e49adf2bbc22c40b98adace2e6856b90baaac04fdde8e90f4d4553b28957578d80395  kscreen-5.19.4.tar.xz"
